package ${package.Mapper};

import ${package.Entity}.${entity};
import org.apache.ibatis.annotations.Param;
import com.github.pagehelper.Page;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * ${table.comment!} Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Mapper
@Repository
public interface ${table.mapperName} extends BaseMapper<${entity}> {

   /**
	* 根据id查询${entity}
	*/
	${entity} get${entity}ById(@Param(value = "<#list table.fields as field><#if field.keyFlag == true>${field.propertyName}</#if></#list>") <#list table.fields as field><#if field.keyFlag == true>${field.columnType?lower_case?cap_first}</#if></#list> id) throws Exception;

	/**
	* 查询${entity}列表
	*/
	List<${entity}> list${entity}(${entity} ${table.entityName?uncap_first}) throws Exception;

	/**
	* 分页查询${entity}列表
	*/
	Page<${entity}> page${entity}(${entity} ${table.entityName?uncap_first}) throws Exception;

	/**
	* 新增${entity}
	*/
	Integer add${entity}(${entity} ${table.entityPath}) throws Exception;

	/**
	* 更新${entity}
	*/
	Integer update${entity}(${entity} ${table.entityPath}) throws Exception;

	/**
	* 根据id物理删除${entity}
	*/
	Integer delete${entity}ById(@Param(value = "<#list table.fields as field><#if field.keyFlag == true>${field.propertyName}</#if></#list>") <#list table.fields as field><#if field.keyFlag == true>${field.columnType?lower_case?cap_first}</#if></#list> id)	throws Exception;

	/**
	* 根据id逻辑删除${entity}
	*/
	Integer remove${entity}ById(@Param(value = "<#list table.fields as field><#if field.keyFlag == true>${field.propertyName}</#if></#list>") <#list table.fields as field><#if field.keyFlag == true>${field.columnType?lower_case?cap_first}</#if></#list> id)	throws Exception;
}
